//
//  GoodsMarkTableViewCell.m
//  MyProject
//
//  Created by dllo on 15/10/30.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "GoodsMarkTableViewCell.h"

@implementation GoodsMarkTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.topImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_topImageView];
        
        self.userImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_userImageView];
        self.userImageView.layer.cornerRadius = [UIScreen mainScreen].bounds.size.width/21.33;
        self.userImageView.clipsToBounds = YES;
        
        self.nameLable = [[UILabel alloc]init];
        [self.contentView addSubview:_nameLable];
        
        self.messageLable = [[UILabel alloc]init];
        [self.contentView addSubview:_messageLable];
        self.messageLable.font = [UIFont systemFontOfSize:14];
        self.messageLable.numberOfLines = 0;
        
        self.timeLable = [[UILabel alloc]init];
        [self.contentView addSubview:_timeLable];
        self.timeLable.font = [UIFont systemFontOfSize:14];
        self.timeLable.textColor = [UIColor grayColor];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.topImageView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height*2/5);
    self.userImageView.frame = CGRectMake(10, 10 + [UIScreen mainScreen].bounds.size.height*2/5, 30, 30);
    self.nameLable.frame = CGRectMake(50, 10 + [UIScreen mainScreen].bounds.size.height*2/5, 200, 15);
    self.timeLable.frame = CGRectMake(50, 10 + [UIScreen mainScreen].bounds.size.height*2/5 + 15, 200, 15);
    self.messageLable.frame = CGRectMake(10, [UIScreen mainScreen].bounds.size.height*2/5 + 50, [UIScreen mainScreen].bounds.size.width - 20, 20);
    [self.messageLable sizeToFit];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
